package com.rcloud.server.sealtalk.constant;

public enum ErrorCode {
    //xunmi server error
    XUNMI_SERVER_FAIL(1000, "系统异常", 200),

    OTHERERROR(5000, "已经在该群", 200),
    //common error
    COOKIE_ERROR(404, "cookie失效", 404),
    SEND_SMS_ERROR(401, "发送验证码失败", 401),
    INPUT_SMS(408, "请输入验证码", 200),
    SERVER_ERROR(500, "服务器异常", 500),
    PARAM_ERROR(400, "参数异常", 400),
    YUN_PIAN_SMS_ERROR(3004, "请求次数过多，请稍后再试", 3004),
    REQUEST_ERROR(400, "请求错误", 400),
    ILLEGAL_PARAMETER(400, "参数无效", 400),
    EMPTY_PARAMETER(400, "参数为空", 400),
    PARAMETER_ERROR(400, "参数错误", 400),

    EMPTY_STACCOUNT_LENGHT_ERROR(400, "参数长度不正确。", 400),
    EMPTY_STACCOUNT_ERROR(400, "不是字母开头或无效符号。", 400),
    USER_STACCOUNT_EXIST(1000, "用户stAccount已经存在。", 200),

    //发送代码
    LIMIT_ERROR(5000, "超出限制。", 200),
    LIMIT_ERROR2(5000, "错误次数过多，请稍后再试", 200),
    INVALID_REGION_PHONE(400, "区域和电话号码无效。", 400),

    //调用rongcloud服务器错误
    INVOKE_RONG_CLOUD_SERVER_ERROR(2000, "融云服务器API错误：", 2000),


    //验证码错误
    UNKOWN_PHONE_NUMBER(404, "未知电话号码。", 404),
    VERIFY_CODE_EXPIRED(2000, "验证码已过期。", 200),
    INVALID_VERIFY_CODE(1000, "验证码无效。", 200),

    //注册错误
    INVALID_PASSWORD(400, "密码不能有空格。", 400),
    INVALID_NICKNAME_LENGTH(400, "昵称长度无效。", 400),
    INVALID_PASSWORD_LENGHT(400, "密码长度无效。", 400),
    INVALID_VERIFICATION_TOKEN(400, "验证令牌无效。", 400),
    UNKNOWN_VERIFICATION_TOKEN(404, "未知验证令牌。", 404),
    PHONE_ALREADY_REGISTERED(400, "手机号已经注册。", 400),

    //登录错误
    USER_NOT_EXIST(1000, "电话号码未找到。", 200),
    USER_PASSWORD_WRONG(1001, "密码错误。", 200),
    USER_PASSWORD_WRONG_2(1000, "原始密码错误。", 200),

    //用户错误
    INVALID_PORTRAITURI_FORMAT(400, "portraitUri 格式无效。", 400),
    INVALID_PORTRAITURI_LENGTH(400, "portraitUri 长度无效。", 400),
    FRIEND_USER_NOT_EXIST(404, "好友id不是可用的用户id。", 404),
    UNKNOW_USER(404, "未知用户。", 404),
    INVALID_REGION_LIST(1000, "区域列表无效。", 1000),
    INVALID_TIMESTAMP_VERSION(400, "版本参数不是整数。", 400),

    //其他错误
    UNSUPPORTED_CONVERSATION_TYPE(403, "不支持的对话类型。", 403),
    NOT_YOUR_FRIEND(403, "用户 {} 不是你的朋友。", 403),
    NOT_YOUR_GROUP(403, "您不是{}组的成员。", 403),


    //好友错误
    INVALID_INVITE_MESSAGE_LENGTH(400, "好友请求消息的长度超出限制。", 400),
    UNKNOW_FRIEND_USER_OR_INVALID_STATUS(404, "未知好友用户或无效状态。", 404),
    NOT_FRIEND_USER(403, "当前用户不是用户的朋友", 403),
    COUNT_GROUP_LIMIT(403, "群人数超限制", 403),
    ALREADY_YOUR_FRIEND(400, "已经是你的朋友。", 400),
    EMPTY_ContactList(400, "联系人列表为空。", 400),


    //组错误
    INVALID_GROUP_NAME_LENGTH(400, "群名长度超出限制。", 400),
    INVALID_GROUP_MEMNBER_COUNT(400, "群组的成员数量至少应大于 1。", 400),
    INVALID_GROUP_MEMNBER_MAX_COUNT(400, "群组成员数量超出最大群组成员数量限制。", 400),
    INVALID_USER_GROUP_COUNT_LIMIT(1000, "当前用户的组数超出最大用户组数限制。", 200),
    INVALID_PARAM_CREATOR(400, "创建者不在成员列表中。", 400),
    GROUP_LIMIT_ERROR(20002, "创建者不在成员列表中。", 20002),
    GROUP_UNKNOWN_ERROR(404, "该群已解散", 404),
    NOT_GROUP_MANAGER(400, "当前用户不是群管理员。", 400),
    NOT_GROUP_MEMBER(400, "不是群组成员", 400),
    NOT_GROUP_OWNER(400, "不是群组所有者。", 400),
    NO_PERMISSION(20001, "无权限", 20001),
    NOT_GROUP_MEMBER_2(403, "只有群成员才能获取群成员信息。", 403),
    INVALID_DISPLAY_NAME_LENGTH(400, "显示名称长度无效。", 400),
    INVALID_GROUP_PORTRAITURI_LENGTH(400, "头像的长度无效。", 400),
    GROUP_OR_CREATOR_UNKNOW(400, "未知群组或不是群主。", 400),
    NO_GROUP_BULLETIN(402, "没有群公告。", 402),
    INVALID_GROUP_BULLETIN(400, "公告长度无效。", 400),
    ALREADY_EXISTS_GROUP(405, "群组已经存在。", 405),
    TRANSFER_TO_CREATOR_ERROR(403, "不能将创建者角色转移给自己。", 403),
    INVALID_GROUPID_USERID(400, "无效的群ID或用户ID。", 400),
    NOT_GROUP_CREATOR(400, "当前用户不是群创建者。", 400),
    QUIT_IM_SERVER_ERROR(500, "在 IM 服务器上退出失败。", 500),
    NOT_GROUP_MEMBER_3(403, "当前用户不是群成员。", 403),
    IS_GROUP_MEMBER(5000, "当前用户是群成员。", 200),
    JOIN_GROUP_ERROR (5000, "群认证状态下不可扫码进群。", 200),
    NOT_GROUP_MANAGER_3(403, "当前用户不是群管理员。", 403),

    CAN_NOT_KICK_YOURSELF(400, "不能踢自己。", 400),
    CAN_NOT_KICK_CREATOR(405, "不能踢群主。", 405),
    GROUP_MEMBER_EMPTY(500, "群组成员不能为空，请检查您的数据库。", 500),
    EMPTY_MEMBERID(400, "空成员ID。", 400),
    CANT_NOT_KICK_NONE_MEMBER(400, "不能踢出非群成员。", 400),
    NOT_IN_MEMBER(403, "不在群内。", 403),
    NO_PERMISSION_SET_MANAGER(401, "没有设置管理器的权限。", 401),
    CAN_NOT_SET_CREATOR(403, "无法设置群主。", 403),
    NO_GROUP(20006, "无群", 200),
    IN_PROTECTED_GROUP(20004, "受保护", 200),
    COPIED_GROUP(20005, "已复制", 200),
    MEMBER_LIMIT(20007, "成员限制", 200),
    NOT_FOUND(20003, "未找到", 200),
    EMPTY_GROUPID(400, "空群ID。", 400),
    GROUPID_NULL(500, "用户ID 不能为空。", 500),
    MemberProtection_NULL(500, "memberProtection 不能为空。", 500),
    STATUS_NULL(500, "状态不能为空。", 500),


    //云片错误 云片服务错误，错误码3000
    YP_SERVER_FAILD(3000, "云片服务器错误", 3000),
    YP_GET_TEMPLATE_FAILD(3001, "获取云片模板失败", 3001),
    YP_TEMPLATE_EMPTY(3002, "云片短信模板为空", 3002),
    YP_SEND_VERIFYCODER_FAILD(3003, "发送云片短信验证失败", 3003),
    YP_SNED_TIMES_VIOLATION(3004, "发送次数过多", 3004);

    private int errorCode;
    private String errorMessage;
    private int httpStatusCode;

    ErrorCode(int errorCode, String errorMessage, int httpStatusCode) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
        this.httpStatusCode = httpStatusCode;

    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public int getHttpStatusCode() {
        return httpStatusCode;
    }

    public void setHttpStatusCode(int httpStatusCode) {
        this.httpStatusCode = httpStatusCode;
    }
}
